]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Use pushModal() to grab the keyboard
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 23 May 2013 13:49:42 +0000 (15:49 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 5 Jun 2013 15:32:49 +0000 (17:32 +0200)
Currently we "only" grab the keyboard when starting a drag operation,
which does not impede keybindings to be processed. This is at best
not harmful (like workspace switching), but may have unintended effects
otherwise - for instance, the hot corner is disabled, so having the
corresponding keyboard shortcut still active is fairly odd (not to
mention that it leaves the system in a confused state).
Fix this by switching to pushModal()/popModal(), which will push a
dedicated keybinding mode for us.

https://bugzilla.gnome.org/show_bug.cgi?id=700877

js/ui/dnd.js

index fab58f565487509c5fac7e41f669ea6cc675805f..c4cc047dcaf66ac6b86771343c2c79a7dfe26ab2 100644 (file)
@@ -147,16 +147,16 @@ const _Draggable = new Lang.Class({
 
     _grabEvents: function() {
         if (!this._eventsGrabbed) {
-            Clutter.grab_pointer(_getEventHandlerActor());
-            Clutter.grab_keyboard(_getEventHandlerActor());
-            this._eventsGrabbed = true;
+            this._eventsGrabbed = Main.pushModal(_getEventHandlerActor());
+            if (this._eventsGrabbed)
+                Clutter.grab_pointer(_getEventHandlerActor());
         }
     },
 
     _ungrabEvents: function() {
         if (this._eventsGrabbed) {
             Clutter.ungrab_pointer();
-            Clutter.ungrab_keyboard();
+            Main.popModal(_getEventHandlerActor());
             this._eventsGrabbed = false;
         }
     },